package auctionhaus



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions
 */
@TestFor(CustomerService)
@Mock(Customer)
class CustomerServiceTests {
    def customerService
    
    public void setUp() {
        customerService = new CustomerService()
    }

    void testAddCustomer() {
        def newCustomer = customerService.addCustomer("johndoe@acme.com", "asdfqwe")
        assert newCustomer.id > 0
    }
    
    void testAddInvalidCustomer() {
        def badCustomer = customerService.addCustomer("bademail", "asdfqwe")
        assert badCustomer.hasErrors()
    }
    
    public void tearDown() {
        customerService = null
    }
}
